<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" name="viewport"
          content="width=1024, initial-scale=1.0, minimum-scale=1, maximum-scale=1, user-scalable=no"/>
    <title>AsyncFlow代码生成器V2</title>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, minimal-ui">
    <script src="https://www.itxst.com/package/vue/vue.min.js"></script>
    <script src="https://www.itxst.com/package/sortable/Sortable.min.js"></script>
    <script src="https://www.itxst.com/package/vuedraggable/vuedraggable.umd.min.js"></script>

    <!--    &lt;!&ndash; 引入样式 &ndash;&gt;-->
    <!--    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">-->
    <!--    &lt;!&ndash; 引入组件库 &ndash;&gt;-->
    <!--    <script src="https://unpkg.com/element-ui/lib/index.js"></script>-->

    <link rel="stylesheet" type="text/css" href="../css/element-ui-index.css"/>
    <script type="text/javascript" src="../js/element-ui-index.js"></script>
    <!-- 引入JQuery -->
    <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.js"></script>
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.1.min.js"></script>
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.1.js"></script>
    <style scoped>
        /*被拖拽对象的样式*/
        .item {
            padding: 6px;
            background-color: #fdfdfd;
            border: solid 1px #eee;
            margin-bottom: 10px;
            cursor: move;
        }

        .item:hover {
            background-color: #f1f1f1;
            cursor: move;
        }

        /*选中样式*/
        .chosen {
            border: solid 2px #3089dc !important;
        }


        /*公共节点悬浮在上面*/
        .box_relative_aside {
            position: fixed;
            left: 30px;
            top: 40px;
            z-index: 999;
            width: 600px;
        }

        .box_relative_main_head {
            position: fixed;
            top: -1px;
            padding-top: 40px;
            background: white;
            z-index: 999;
        }

        .box_relative_main_foot {
            margin-top: 200px;
            /*position: relative;*/
            /*right: 30px;*/
            /*top: 300px;*/
        }

    </style>
</head>
<body>

<div id="app" style="width: 100%">
    <el-container style="width: 100%">
        <el-aside style="width: 35%">
            <div class="box_relative_aside" style="width: 35%">
                <el-form :model="asyncFlowPubNodeInfoList" ref="asyncFlowPubNodeInfoList">
                    <el-form-item prop="asyncFlowPublic">
                        <el-select v-model="selectPubNodeValue" multiple filterable placeholder="请选择[公共节点]"
                                   style="width:80%">
                            <el-option
                                    v-for="item in PubNodeOptions"
                                    :key="item.value"
                                    :label="item.label+'【'+item.value+'】'"
                                    :value="item.value">
                            </el-option>
                        </el-select>
                        <el-tooltip effect="dark" content="将选择的公共节点添加到右侧异步流中" placement="right-start">
                            <el-button @click.prevent="addPubNode(selectPubNodeValue)" style="width:13%">添加</el-button>
                        </el-tooltip>
                    </el-form-item>
                </el-form>
            </div>
        </el-aside>
        <el-main style="width: 65%">
            <el-form :model="velocityRequest" label-position="right" ref="velocityRequest" style="width: 100%">
                <div class="box_relative_main_head" style="width: 100%">
                    <el-form-item prop="asyncFlowModuleName" style="width: 90%">

                        <el-input v-model="velocityRequest.asyncFlowModuleName" placeholder="异步流模块英文名称"
                                  :disabled="managerNameDisabled"
                                  style="width: 24%">
                            <template slot="prepend">模块名称:</template>
                        </el-input>
                        <el-select v-model="selectManagerValue" filterable placeholder="请选择[系统模块]" style="width:36%">
                            <el-option
                                    v-for="item in ManagerOptions"
                                    :key="item.value"
                                    :label="item.label+'【'+item.value+'】'"
                                    :value="item.value">
                            </el-option>
                        </el-select>
                        <el-tooltip effect="dark" content="加载选择Manager的所有节点" placement="left-start">
                            <el-button type="primary" @click="loadManagerNode(selectManagerValue)" style="width:5%">加载
                            </el-button>
                        </el-tooltip>
                    </el-form-item>
                    <el-form-item prop="asyncFlowOperatorEnum" style="width: 90%">
                        <!--                        <template slot-scope="scope">-->

                        <el-select v-model="selectOperatorEnumValue"
                                   placeholder="请选择[节点操作枚举]" @change="selectOperatorEnum()"
                                   style="width:24%">
                            <el-option
                                    v-for="item in OperatorEnumOptions"
                                    :key="item.value"
                                    :label="item.value+'【'+item.label+'】'"

                                    :value="item.value">
                            </el-option>
                        </el-select>

                        <el-input v-model="selectOperatorEnumName" placeholder="枚举Name"
                                  style="width: 17%">
                            <template slot="prepend">枚举Name:</template>
                        </el-input>
                        <el-input v-model="selectOperatorEnumMsg" placeholder="枚举Msg"
                                  style="width: 17%">
                            <template slot="prepend">枚举Msg:</template>
                        </el-input>
                        <el-tooltip effect="dark" content="新增枚举" placement="left-start">
                            <el-button type="primary" icon="el-icon-plus" style="width: 3%"
                                       @click="addOperatorEnum(selectOperatorEnumName,selectOperatorEnumMsg,true)">
                            </el-button>
                        </el-tooltip>
                        <el-tooltip effect="dark" content="删除枚举" placement="right-start">
                            <el-button type="primary" icon="el-icon-minus" style="width: 3%"
                                       @click="removeOperatorEnum(selectOperatorEnumName,selectOperatorEnumMsg)">
                            </el-button>
                        </el-tooltip>

                    </el-form-item>
                    <!--                    <el-form-item prop="asyncFlowDes" label="异步流模块中文描述">-->
                    <!--                        <el-input v-model="velocityRequest.asyncFlowModuleDes"></el-input>-->

                    <!--                    </el-form-item>-->
                    <el-form-item prop="asyncFlowMaintainInfo" style="width: 90%">
                        <el-input v-model="velocityRequest.asyncFlowModuleDes" placeholder="异步流模块描述"
                                  style="width: 31%">
                            <template slot="prepend">模块描述:</template>
                        </el-input>
                        <el-input v-model="velocityRequest.asyncFlowTimeOutsLimit" placeholder="超时时间[ms]"
                                  style="width: 16%">
                            <template slot="prepend">超时时间[ms]:</template>
                        </el-input>
                        <el-input v-model="velocityRequest.asyncFlowMaintainName" placeholder="负责人[唯一标识工号等]"
                                  style="width: 18%">
                            <template slot="prepend">负责人:</template>
                        </el-input>

                    </el-form-item>

                </div>
                <div class="box_relative_main_foot" style="width: 100%">
                    <draggable v-model="velocityRequest.asyncFlowNodeInfoList" handle=".mover" chosen-class="chosen"
                               force-fallback="true"
                               animation="300">
                        <transition-group>
                            <el-form-item
                                    v-for="(asyncFlowNodeInfo, index) in velocityRequest.asyncFlowNodeInfoList"
                                    :label="asyncFlowNodeInfo.addDes+'节点' + (index+1)"
                                    :key="asyncFlowNodeInfo.key"
                                    label-width="100px"
                                    style="width:100%">
                                <el-tooltip effect="dark" content="上下拖动" placement="left-start">
                                    <el-button type="primary" class="mover" icon="el-icon-d-caret"
                                               style="width: 6%"></el-button>
                                </el-tooltip>
                                <el-select v-model="asyncFlowNodeInfo.executeEnum" placeholder="请选择"
                                           :disabled="asyncFlowNodeInfo.nodeTypeEnum=='OldSpecialNode'||asyncFlowNodeInfo.nodeTypeEnum=='OldPubNode'"
                                           style="width: 8%">
                                    <el-option
                                            v-for="item in ExecuteOptions"
                                            :key="item.value"
                                            :label="item.label"
                                            :value="item.value">
                                    </el-option>
                                </el-select>
                                <el-input v-model="asyncFlowNodeInfo.asyncFlowNodeFileName" placeholder="节点文件名"
                                          :disabled="asyncFlowNodeInfo.nodeTypeEnum=='OldSpecialNode'||asyncFlowNodeInfo.nodeTypeEnum=='OldPubNode'"
                                          style="width:29%">
                                    <template
                                            v-if="asyncFlowNodeInfo.nodeTypeEnum=='NewSpecialNode'||asyncFlowNodeInfo.nodeTypeEnum=='NewPubNode'"
                                            slot="append">{{asyncFlowNodeInfo.executeEnum}}
                                    </template>
                                </el-input>
                                <el-select v-model="asyncFlowNodeInfo.async" placeholder="请选择" style="width: 8%">
                                    <el-option
                                            v-for="item in AsyncOptions"
                                            :key="item.value"
                                            :label="item.label"
                                            :value="item.value">
                                    </el-option>
                                </el-select>
                                <el-input v-model="asyncFlowNodeInfo.asyncFlowNodeDes" placeholder="节点描述[当前节点的功能描述]"
                                          :disabled="asyncFlowNodeInfo.nodeTypeEnum=='OldSpecialNode'||asyncFlowNodeInfo.nodeTypeEnum=='OldPubNode'"
                                          style="width: 30%"></el-input>
                                <el-tooltip effect="dark" content="在下方新增节点" placement="left-start">
                                    <el-button type="primary" icon="el-icon-plus" style="width: 5%"
                                               @click="addNode(asyncFlowNodeInfo,1)">
                                    </el-button>
                                </el-tooltip>
                                <el-tooltip effect="dark" content="删除当前节点" placement="top-start">
                                    <el-button type="primary" icon="el-icon-minus" style="width: 5%"
                                               @click="removeNode(asyncFlowNodeInfo)">
                                    </el-button>
                                </el-tooltip>
                            </el-form-item>
                        </transition-group>
                    </draggable>
                    <el-form-item label-width="140px">
                        <el-checkbox v-model="velocityRequest.replaceManager" label="重新生成Manager" border></el-checkbox>
                        <el-button type="primary" @click="submitForm('velocityRequest')">生成</el-button>
                        <el-button type="primary" @click="addNode()">新增节点</el-button>
                    </el-form-item>
                </div>
            </el-form>
        </el-main>
    </el-container>
</div>

<script>
    // 全局注册组件 拖拽组件
    Vue.component('vuedraggable', window.vuedraggable);
    var app = new Vue({
            el: '#app',
            components: {
                vuedraggable: window.vuedraggable,//当前页面注册组件
            },
            data() {
                return {
                    drag: false,
                    urlPath: window.location.href.replace('/asyncFlowWeb/codeGenerationWeb', '/AsyncFlowAPI'),
                    velocityRequest: {
                        asyncFlowNodeInfoList: [],
                        asyncFlowOperatorEnumInfoList: [],
                        asyncFlowModuleName: '',
                        asyncFlowModuleDes: '',
                        asyncFlowMaintainName: '',
                        asyncFlowTimeOutsLimit: '',
                        replaceManager: false,
                    },
                    ExecuteOptions: [{
                        value: 'Validator',
                        label: '验证'
                    }, {
                        value: 'GetData',
                        label: '查询'
                    }, {
                        value: 'GetDataPub',
                        label: '公共查询'
                    }, {
                        value: 'Operator',
                        label: '操作'
                    }, {
                        value: 'Sync',
                        label: '同步'
                    }, {
                        value: 'Async',
                        label: '异步'
                    }],
                    AsyncOptions: [{
                        value: true,
                        label: '异步'
                    }, {
                        value: false,
                        label: '同步'
                    }],
                    PubNodeOptions: [],//系统中所有的公共节点下拉集合
                    selectPubNodeValue: '',
                    ManagerOptions: [],//系统中所有的Manager下拉集合
                    OperatorEnumOptions: [],//选中的Manager对应操作枚举下拉集合
                    selectManagerValue: '',
                    selectOperatorEnumValue: '',

                    selectOperatorEnumName: '',//新增枚举值名称
                    selectOperatorEnumMsg: '',
                    asyncFlowPubNodeInfoList: [],//公共节点集合
                    asyncFlowValidatorNodeInfoList: [],//验证节点集合
                    asyncFlowGetDataNodeInfoList: [],//数据查询节点集合
                    asyncFlowOperatorNodeInfoList: [],//操作节点集合
                    asyncFlowPubSyncInfoList: [],//同步节点集合
                    asyncFlowPubAsyncInfoList: [],//异步节点集合
                    moveAsyncFlowNodeFileName: 'moveAsyncFlowNodeFileName',
                    managerNameDisabled: false,//异步流英文名称是否可修改，如果是系统存在的则不允许修改
                    notifyPromise: Promise.resolve(),
                };
            },
            mounted: function () {
                this.loadPubNode();
            },
            methods: {
                loadPubNode() {
                    const self = this;
                    $.ajax({
                        type: "POST",
                        url: this.urlPath + "/loadPubNodeManager",
                        dataType: "json",
                        contentType: "application/json",
                        success: function (result) {
                            //self.asyncFlowPubNodeInfoList = result;
                            for (let i = 0; i < result.length; i++) {
                                if (result[i].executeEnum === "Manager") {
                                    self.ManagerOptions.push({
                                        value: result[i].asyncFlowNodeFileName,
                                        label: result[i].asyncFlowNodeDes
                                    });
                                } else {
                                    self.PubNodeOptions.push({
                                        value: result[i].asyncFlowNodeFileName,
                                        label: "【" + result[i].executeEnum + "】" + result[i].asyncFlowNodeDes
                                    });
                                    self.asyncFlowPubNodeInfoList.push(result[i]);
                                }

                            }
                            self.$forceUpdate();
                        }

                    });
                },
                submitForm(formName) {
                    const self = this;
                    if (self.velocityRequest.asyncFlowOperatorEnumInfoList.length === 0) {
                        self.notify("请添加节点操作枚举", "warning", 1000);
                        return;
                    }

                    const data = self.velocityRequest;
                    if (self.velocityRequest.asyncFlowNodeInfoList.length === 0) {
                        self.notify("请至少添加一个操作节点", "warning", 1000);
                        return;
                    }
                    for (let i = 0; i < self.velocityRequest.asyncFlowNodeInfoList.length; i++) {
                        if (self.velocityRequest.asyncFlowNodeInfoList[i].nodeTypeEnum === "NewSpecialNode"
                            || self.velocityRequest.asyncFlowNodeInfoList[i] === "NewPubNode") {
                            self.velocityRequest.asyncFlowNodeInfoList[i].asyncFlowNodeFileName = self.velocityRequest.asyncFlowNodeInfoList[i].asyncFlowNodeFileName + this.velocityRequest.asyncFlowNodeInfoList[i].executeEnum;
                        }
                    }
                    //提交之前调用 枚举选择方法，给选中的枚举赋值
                    self.selectOperatorEnum();
                    $.ajax({
                        type: "POST",
                        url: this.urlPath + "/codeGeneration",
                        contentType: "application/json;charset=utf-8",
                        data: JSON.stringify(data),
                        success: function (result) {
                            if (result === "生成成功") {
                                self.notify(result, "success", 1000);
                            } else {
                                self.notify(result, "warning", 1000);
                            }

                        }

                    });
                },

                loadManagerNode(asyncFlowModuleName) {
                    const self = this;


                    if (asyncFlowModuleName === null || asyncFlowModuleName === "") {
                        self.notify("请选择具体Manager", "warning", 1000);
                        return;
                    }

                    $.ajax({
                        type: "GET",
                        url: this.urlPath + "/loadManagerNode",
                        dataType: "json",
                        contentType: "application/json;charset=utf-8",
                        data: "asyncFlowModuleName=" + asyncFlowModuleName,
                        success: function (result) {

                            //加载系统中的异步流，  异步流加载成功之后,当前流的英文名称不允许修改
                            self.managerNameDisabled = true;
                            self.velocityRequest.asyncFlowNodeInfoList = [];
                            self.velocityRequest.asyncFlowOperatorEnumInfoList = [];
                            self.OperatorEnumOptions = [];

                            self.velocityRequest.asyncFlowMaintainName = result.asyncFlowMaintainName;
                            self.velocityRequest.asyncFlowModuleDes = result.asyncFlowModuleDes;
                            self.velocityRequest.asyncFlowModuleName = result.asyncFlowModuleName;
                            self.velocityRequest.asyncFlowTimeOutsLimit = result.asyncFlowTimeOutsLimit;
                            for (let i = 0; i < result.asyncFlowNodeInfoList.length; i++) {
                                self.addNode(result.asyncFlowNodeInfoList[i]);
                            }
                            if (result.asyncFlowOperatorEnumInfoList.length === 0) {
                                self.notify("当前异步流未找到对应的操作枚举，请确认", "warning", 0);
                            }
                            for (let i = 0; i < result.asyncFlowOperatorEnumInfoList.length; i++) {

                                self.addOperatorEnum(result.asyncFlowOperatorEnumInfoList[i].name, result.asyncFlowOperatorEnumInfoList[i].msg, false)
                            }

                        }

                    });
                },
                addOperatorEnum(addOperatorEnumName, addOperatorEnumMsg, newEnumValue) {
                    if (addOperatorEnumName === "" || addOperatorEnumMsg === "") {
                        this.notify("请输入正确的枚举值和枚举名称", "warning", 1000);
                        return;
                    }
                    const hasSome = this.velocityRequest.asyncFlowOperatorEnumInfoList.some(item => {
                        if (item.name === addOperatorEnumName || item.msg === addOperatorEnumMsg) {
                            return true;
                        }
                    });
                    const hasSomeOperatorEnumOptions = this.OperatorEnumOptions.some(item => {
                        if (item.value === addOperatorEnumName || item.label === addOperatorEnumMsg) {
                            return true;
                        }
                    });
                    if (hasSome || hasSomeOperatorEnumOptions) {
                        this.notify("已经存在相同的枚举，Name：" + addOperatorEnumName + "；Msg：" + addOperatorEnumMsg, "warning", 2000);
                        return;
                    }

                    if (hasSome === false) {
                        this.velocityRequest.asyncFlowOperatorEnumInfoList.push({
                            name: addOperatorEnumName,
                            code: this.velocityRequest.asyncFlowOperatorEnumInfoList.length + 1,
                            msg: addOperatorEnumMsg,
                            newEnumValue: newEnumValue,
                            select: false,
                            key: Date.now()
                        });
                    }
                    if (hasSomeOperatorEnumOptions === false) {
                        this.OperatorEnumOptions.push({
                            value: addOperatorEnumName,
                            label: addOperatorEnumMsg
                        });
                        this.selectOperatorEnumValue = addOperatorEnumName;

                    }
                    // if (newEnumValue === false) {
                    //     this.selectOperatorEnumName = addOperatorEnumName;
                    //     this.selectOperatorEnumMsg = addOperatorEnumMsg;
                    // }

                },
                removeOperatorEnum(addOperatorEnumName, addOperatorEnumMsg) {
                    if (addOperatorEnumName === "" || addOperatorEnumMsg === "") {
                        this.notify("请输入正确的枚举值和枚举名称", "warning", 1000);
                        return;
                    }
                    const hasSome = this.velocityRequest.asyncFlowOperatorEnumInfoList.some(item => {
                        if (item.name === addOperatorEnumName || item.msg === addOperatorEnumMsg) {
                            return true;
                        }
                    });
                    if (hasSome === false) {
                        this.notify("不存在当前枚举，无法删除，Name：" + addOperatorEnumName + "；Msg：" + addOperatorEnumMsg, "warning", 2000);
                        return;
                    }
                    if (addOperatorEnumName === "Defaults") {
                        this.notify("默认枚举不允许删除", "warning", 1000);
                        return;
                    }
                    for (let i = 0; i < this.velocityRequest.asyncFlowOperatorEnumInfoList.length; i++) {
                        if (this.velocityRequest.asyncFlowOperatorEnumInfoList[i].name === addOperatorEnumName && this.velocityRequest.asyncFlowOperatorEnumInfoList.msg === addOperatorEnumMsg) {

                            if (this.velocityRequest.asyncFlowOperatorEnumInfoList[i].newEnumValue) {
                                this.velocityRequest.asyncFlowOperatorEnumInfoList.splice(i, 1);
                                i--;
                                break;
                            } else {
                                this.notify("系统已经存在的枚举不允许删除", "warning", 1000);
                                return;
                            }

                        }
                    }
                    for (let i = 0; i < this.OperatorEnumOptions.length; i++) {
                        if (this.OperatorEnumOptions[i].value === addOperatorEnumName && this.OperatorEnumOptions[i].label === addOperatorEnumMsg) {
                            this.OperatorEnumOptions.splice(i, 1);
                            i--;
                            break;
                        }
                    }

                    this.selectOperatorEnumValue = "";
                    this.selectOperatorEnumName = "";
                    this.selectOperatorEnumMsg = "";

                },
                selectOperatorEnum() {
                    this.$forceUpdate();
                    this.selectOperatorEnumName = this.selectOperatorEnumValue;
                    for (let i = 0; i < this.velocityRequest.asyncFlowOperatorEnumInfoList.length; i++) {

                        if (this.velocityRequest.asyncFlowOperatorEnumInfoList[i].name === this.selectOperatorEnumValue) {
                            this.selectOperatorEnumMsg = this.velocityRequest.asyncFlowOperatorEnumInfoList[i].msg;
                            this.velocityRequest.asyncFlowOperatorEnumInfoList[i].select = true;
                            break;
                        }
                    }

                },
                removeNode(item) {
                    const index = this.velocityRequest.asyncFlowNodeInfoList.indexOf(item);
                    if (index !== -1) {
                        this.velocityRequest.asyncFlowNodeInfoList.splice(index, 1)
                    }
                }
                ,
                addNode(item, type) {
                    if (item) {
                        item.key = Date.now();

                        const length = this.velocityRequest.asyncFlowNodeInfoList.length;
                        //默认加在最后面
                        let index = length + 1;
                        //在点击节点的下一个节点新增
                        if (type === 1) {
                            index = this.velocityRequest.asyncFlowNodeInfoList.indexOf(item) + 1;
                            item =
                                {
                                    executeEnum: item.executeEnum,
                                    asyncFlowNodeFileName: '',
                                    async: item.async,
                                    asyncFlowNodeDes: '',
                                    asyncFlowNodePackagePath: '',
                                    asyncFlowNodeFilePath: '',
                                    nodeTypeEnum: "NewSpecialNode",
                                    addDes: '',
                                    key: Date.now()
                                };
                        } else {
                            //公共节点新增
                            for (let i = length - 1; i >= 0; i--) {

                                if (this.velocityRequest.asyncFlowNodeInfoList[i].executeEnum === item.executeEnum) {
                                    index = i + 1;
                                    break;
                                }
                            }
                            if (type === 2) {
                                item.addDes = "[新增]";
                            } else {
                                item.addDes = "";
                            }

                        }

                        this.velocityRequest.asyncFlowNodeInfoList.splice(index, 0, item);
                    } else {
                        //在最后新增
                        this.velocityRequest.asyncFlowNodeInfoList.push({
                            executeEnum: 'Operator',
                            asyncFlowNodeFileName: '',
                            async: false,
                            asyncFlowNodeDes: '',
                            asyncFlowNodePackagePath: '',
                            asyncFlowNodeFilePath: '',
                            nodeTypeEnum: "NewSpecialNode",
                            addDes: '',
                            key: Date.now()
                        });
                    }
                }
                ,
                addPubNode(item) {
                    if (item) {
                        for (let i = 0; i < item.length; i++) {
                            //先判断集合中是否存在本次添加的节点，如果存在直接跳出
                            let findnode = this.velocityRequest.asyncFlowNodeInfoList.filter((m) => {
                                return m.asyncFlowNodeFileName === item[i]
                            });
                            if (findnode.length >= 1) {
                                let msg = findnode[0].asyncFlowNodeFileName + "【" + findnode[0].asyncFlowNodeDes + "】已存在不进行添加";
                                this.notify(msg, "warning", 0);
                                continue;
                            }
                            //找到需要添加的集合
                            let node = this.asyncFlowPubNodeInfoList.filter((m) => {
                                return m.asyncFlowNodeFileName === item[i]
                            });
                            if (node && node.length === 1) {
                                this.addNode(node[0], 2);
                                let msg = node[0].asyncFlowNodeFileName + '【' + node[0].asyncFlowNodeDes + ']添加成功';
                                this.notify(msg, "success", 1000);
                            }
                            //this.velocityRequest.asyncFlowNodeInfoList.splice(2,0,"William")
                        }
                        //添加完成之后 清空选中的公共节点
                        this.selectPubNodeValue = [];
                    }

                }
                ,
                notify(msg, type, duration) {
                    let title = "";

                    if (type === "success") {
                        title = "成功";
                    }
                    if (type === "warning") {
                        title = "警告";
                    }
                    this.notifyPromise = this.notifyPromise.then(this.$nextTick).then(() => {
                        this.$notify({
                            title: title,
                            message: msg,
                            dangerouslyUseHTMLString: true,
                            duration: duration,
                            type: type,
                            position: "top-right"
                        });
                    })
                }
                ,
            }
        })
    ;
</script>
</body>
</html>